import request from '@/utils/request'
// 热门搜索相关的数据接口
export interface HotKeywordVOModel {
  keyword: string,
  schemeUrl: null,
  highlight: number,
  hidden: number,
  type: number,
  algSort: boolean,
}
export type HotKeywordVOListModel = HotKeywordVOModel[]

export default {
  // 获取到热门搜索的列表
  getHotKeywordList() {
    return request.get('/wy/xhr/search/init.json')
  },
  getSearchGoodsList(keyword: string) {
    return request.get(`/wy/xhr/search/search.json?__timestamp=1630133434953&keyword=${keyword}&needPopWindow=true&searchWordSource=7&stillSearch=false&_stat_search=autoComplete&itemId=0&size=40&upperPrice=-1&floorPrice=-1&matchType=0&categoryId=0&descSorted=false&sortType=0&`)
  },
  // 实时获取搜索列表
  getRealTimeKeywordList(keywordPrefix: string) {
    return request.get(`/wy/xhr/search/searchAutoComplete.json?keywordPrefix=${keywordPrefix}`)
  }
}